<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Demo</title>
</head>
<body>
<div id="console"></div>
<div id="container">
    <h1>
        hello world
    </h1>
</div>
<button id="btn" >点我一下调用服务</button>

</body>
<script src="js/jquery-2.2.3.min.js"></script>
<script>
    $(function () {
        $("#btn").click(function () {
            //alert("hello world");
            $.ajax({
                method: 'GET',
                url: '/hello',
                headers: {
                    'Service-Name': 'HelloService'
                },
                success: function (data) {
                    $("#console").text(data);
                }
            })
        });

    })
</script>
</html>